Player = {}
Player.new = function(x, y)
	local self = {}
	local width = width
	local height = height
	local x = x or 0
	local y = y or 0
	local velX = 0
	local velY = 0
	local image = love.graphics.newImage("img/player.png")
	local direction = 1
	local tileX = 1
	local tileY = 1
	
	self.getWidth = function() return width end
	self.getHeight = function() return height end
	self.getX = function() return x end
	self.getY = function() return y end
	self.getVelX = function() return velX end
	self.getVelY = function() return velY end
	self.getImage = function() return image end
	self.getTileX = function() return tileX end
	self.getTileY = function() return tileY end
	
	self.setX = function(val) x = val end
	self.setY = function(val) y = val end
	self.setVelX = function(val) velX = val end
	self.setVelY = function(val) velY = val end
	
	function self:update(dt)
		x = x + velX * dt
		y = y + velY * dt
		
		tileX = math.floor((player.getX() + 25) / 90) + 1
		tileY = math.floor((player.getY() + 80) / 60) + 1
		
		velX = 0
		velY = 0
	end
	
	function self:draw()
		love.graphics.draw(image, math.floor(x), math.floor(y), 0, 1, 1)
		love.graphics.setColor( 255, 255, 255, 100 )
		love.graphics.rectangle( "fill", (tileX - 1) * 90, (tileY - 1) * 60, 90, 60 )
		love.graphics.setColor( 255, 255, 255, 255 )
	end
	
	setmetatable(self, Player)
	return self
end